3.60 \(\int e^{x^2} \cos (a+b x) \, dx\)

Optimal. Leaf size=77 \[ \frac {1}{4} \sqrt {\pi } e^{\frac {b^2}{4}-i a} \text {erfi}\left (\frac {1}{2} (2 x-i b)\right )+\frac {1}{4} \sqrt {\pi } e^{\frac {b^2}{4}+i a} \text {erfi}\left (\frac {1}{2} (2 x+i b)\right ) \]

[Out]

-1/4*exp(-I*a+1/4*b^2)*erfi(1/2*I*b-x)*Pi^(1/2)+1/4*exp(I*a+1/4*b^2)*erfi(1/2*I*b+x)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4473, 2234, 2204} \[ \frac {1}{4} \sqrt {\pi } e^{\frac {b^2}{4}-i a} \text {Erfi}\left (\frac {1}{2} (2 x-i b)\right )+\frac {1}{4} \sqrt {\pi } e^{\frac {b^2}{4}+i a} \text {Erfi}\left (\frac {1}{2} (2 x+i b)\right ) \]

Antiderivative was successfully verified.

[In]

Int[E^x^2*Cos[a + b*x],x]

[Out]

(E^((-I)*a + b^2/4)*Sqrt[Pi]*Erfi[((-I)*b + 2*x)/2])/4 + (E^(I*a + b^2/4)*Sqrt[Pi]*Erfi[(I*b + 2*x)/2])/4

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 4473

Int[Cos[v_]^(n_.)*(F_)^(u_), x_Symbol] :> Int[ExpandTrigToExp[F^u, Cos[v]^n, x], x] /; FreeQ[F, x] && (LinearQ
[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, x] || PolyQ[v, x, 2]) && IGtQ[n, 0]

Rubi steps

\begin {align*} \int e^{x^2} \cos (a+b x) \, dx &=\int \left (\frac {1}{2} e^{-i a-i b x+x^2}+\frac {1}{2} e^{i a+i b x+x^2}\right ) \, dx\\ &=\frac {1}{2} \int e^{-i a-i b x+x^2} \, dx+\frac {1}{2} \int e^{i a+i b x+x^2} \, dx\\ &=\frac {1}{2} e^{-i a+\frac {b^2}{4}} \int e^{\frac {1}{4} (-i b+2 x)^2} \, dx+\frac {1}{2} e^{i a+\frac {b^2}{4}} \int e^{\frac {1}{4} (i b+2 x)^2} \, dx\\ &=\frac {1}{4} e^{-i a+\frac {b^2}{4}} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (-i b+2 x)\right )+\frac {1}{4} e^{i a+\frac {b^2}{4}} \sqrt {\pi } \text {erfi}\left (\frac {1}{2} (i b+2 x)\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 82, normalized size = 1.06 \[ \frac {1}{4} \sqrt {\pi } e^{\frac {b^2}{4}} \left (-\sin (a) \left (\text {erf}\left (\frac {b}{2}-i x\right )+\text {erf}\left (\frac {b}{2}+i x\right )\right )+\cos (a) \text {erfi}\left (\frac {1}{2} (2 x-i b)\right )+\cos (a) \text {erfi}\left (\frac {1}{2} (2 x+i b)\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[E^x^2*Cos[a + b*x],x]

[Out]

(E^(b^2/4)*Sqrt[Pi]*(Cos[a]*Erfi[((-I)*b + 2*x)/2] + Cos[a]*Erfi[(I*b + 2*x)/2] - (Erf[b/2 - I*x] + Erf[b/2 +
I*x])*Sin[a]))/4

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 46, normalized size = 0.60 \[ \frac {1}{4} \, \sqrt {\pi } {\left (-i \, \operatorname {erf}\left (-\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2} + i \, a\right )} - i \, \operatorname {erf}\left (\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2} - i \, a\right )}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*cos(b*x+a),x, algorithm="fricas")

[Out]

1/4*sqrt(pi)*(-I*erf(-1/2*b + I*x)*e^(1/4*b^2 + I*a) - I*erf(1/2*b + I*x)*e^(1/4*b^2 - I*a))

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos \left (b x + a\right ) e^{\left (x^{2}\right )}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*cos(b*x+a),x, algorithm="giac")

[Out]

integrate(cos(b*x + a)*e^(x^2), x)

________________________________________________________________________________________

maple [A]  time = 0.08, size = 54, normalized size = 0.70 \[ -\frac {i \sqrt {\pi }\, {\mathrm e}^{\frac {b^{2}}{4}} {\mathrm e}^{-i a} \erf \left (i x +\frac {b}{2}\right )}{4}+\frac {i \sqrt {\pi }\, {\mathrm e}^{\frac {b^{2}}{4}} {\mathrm e}^{i a} \erf \left (-i x +\frac {b}{2}\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x^2)*cos(b*x+a),x)

[Out]

-1/4*I*Pi^(1/2)*exp(1/4*b^2)*exp(-I*a)*erf(I*x+1/2*b)+1/4*I*Pi^(1/2)*exp(1/4*b^2)*exp(I*a)*erf(-I*x+1/2*b)

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 52, normalized size = 0.68 \[ -\frac {1}{4} \, \sqrt {\pi } {\left ({\left (i \, \cos \relax (a) + \sin \relax (a)\right )} \operatorname {erf}\left (\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2}\right )} + {\left (i \, \cos \relax (a) - \sin \relax (a)\right )} \operatorname {erf}\left (-\frac {1}{2} \, b + i \, x\right ) e^{\left (\frac {1}{4} \, b^{2}\right )}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*cos(b*x+a),x, algorithm="maxima")

[Out]

-1/4*sqrt(pi)*((I*cos(a) + sin(a))*erf(1/2*b + I*x)*e^(1/4*b^2) + (I*cos(a) - sin(a))*erf(-1/2*b + I*x)*e^(1/4
*b^2))

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \cos \left (a+b\,x\right )\,{\mathrm {e}}^{x^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*x)*exp(x^2),x)

[Out]

int(cos(a + b*x)*exp(x^2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int e^{x^{2}} \cos {\left (a + b x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x**2)*cos(b*x+a),x)

[Out]

Integral(exp(x**2)*cos(a + b*x), x)

________________________________________________________________________________________